<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
        .num1 {
            width: 100px;
            height: 200px;
            background: red;
            float: left;
        }
        
        .num2 {
            width: 100px;
            height: 200px;
            background: pink;
            float: left;
            display: none;
        }
    </style>
</head>

<body>
    <div class="num1"></div>
    <div class="num2"></div>
    <script>
        var num_1 = document.getElementsByClassName("num1")[0];
        var num_2 = document.getElementsByClassName("num2")[0];

        num_1.onmouseover = function() {
            console.log("移入");
            num_2.style.display = "block";
        };
        num_1.onmouseout = function() {
            console.log("移出");
            num_2.style.display = "none";
        };
    </script>
</body>

</html>